{extend name="template/base_default"}
{block name="header"}
<link rel="stylesheet" href="__CSS__/common.css">
<link rel="stylesheet" href="__CSS__/weui.min.css">
<link rel="stylesheet" href="__CSS__/index.css">
<link rel="stylesheet" href="__CSS__/weuix.min.css"/>
<script type="text/javascript" src="__JS__/boye-city-picker.js"></script>
<script type="text/javascript" src="__JS__/jquery-weui.min.js"></script>
<script src="__JS__/zepto.min.js"></script>
<script src="__JS__/lrz.min.js"></script>
<style>

    .form-head{
        padding-top: 20px;
        color: white;
        font-size: 16px;
        background-color: rgba(95, 110, 170, 0.4);;
        border-radius: 5px;
        overflow: hidden;
        padding-bottom: 20px;
    }
    .form-head2{
        color: white;
        font-size: 16px;
        background-color: rgba(95, 110, 170, 0.4);;
        border-radius: 5px;
        overflow: hidden;
        height:280px;
        float: left;
        width:100%;
        margin-top: 20px;

    }
    body{
        background-image:url("__IMG__/bj.png");
        background-repeat:repeat-y;
        background-size:cover;
        text-align: center;
    }
    button{
        border: none;
        color:white;
        width:100%;
        float:left;
        height: 100%;
        font-size: 18px;
        font-family: "Microsoft YaHei UI";
    }
    .botton1{
        background-color: #FF0000;
    }
    .botton2{
        background-color: #131a34;
    }
    .form-head2 input{
        width:10%;
        height:20px;
        line-height: 30px;
        margin-top: 20px;
        margin-left: 40px;

    }
    .bank{
        width:100%;
        height:50px;
        line-height: 30px;
        text-align: left;
        font-size: 16px;
        margin-left: 30px;
    }
    .h1-title{
        height:60px;
        border-radius: 100px;
        background-color: white;
        width:90%;
        margin-left: auto;
        margin-right: auto;
        line-height: 60px;
        background-color: rgba(95, 110, 170, 0.4);;
        color:white;
        margin-top: 10px;
    }
    .form-input3-input{
        padding: 10px;
        line-height:16px;
    }
    .form-input3-label{
        color: #dddddd;
        position: relative;
        float: left;
        margin-left: 15px;
        margin-right: 15px;
        width:26%;
        text-align: left;频
    }
</style>
{/block}
{block name="body"}
<div class="h1-title">我的收入<span>{$score/100}</span></div>
<form action="{:url('login/register')}" method="post" style="width:95%;margin: auto;margin-top: 20px">
    <div class="form-head">
        <div class="form-input3" style="">
            <label for="name" class="form-input3-label">姓名:</label>
            <input class="form-input3-input" id="name" name="name" type="text" value="" placeholder=" ">
        </div>
        <div class="form-input3">
            <label for="mobile" class="form-input3-label">联系方式:</label>
            <input class="form-input3-input" name="mobile" id="mobile" type="text" value="">
        </div>
        <div class="form-input3">
            <label for="score" class="form-input3-label">提现金额:</label>
            <input class="form-input3-input" name="score" id="score" type="text" value="">
        </div>
        <div class="form-input3">
            <label for="name" class="form-input3-label">银行卡号:</label>
            <input class="form-input3-input" id="bank_card_no" name="bank_card_no" type="text" value="" placeholder="">
        </div>
        <div class="weui-cell">
            <div class="weui-cell__hd">选择省市区</div>
            <div class="weui-cell__bd">
                <input class="weui-input" style="padding-left: 20px" id="select" type="button" placeholder="请选择所在省市区" value="北京 北京 东城">
            </div>
        </div>
        <div class="form-input3">
            <label for="name" class="form-input3-label">开户行:</label>
            <input class="form-input3-input" id="kh" name="kh" type="text" value="" placeholder="">
        </div>
    </div>

    <div class="form-head2" style="margin-bottom: 20px;float: left">

        <label for="nongye"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="nongye" value="中国农行银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/1.png"> </div></label>
        <label for="jiaotong"><div class="bank"><input  style="margin-left: 26px;position:relative;bottom: 8px"  type="radio" name="bank" id="jiaotong" value="中国交通银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/2.png"></div></label>
        <label for="jiaotong"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="gongshang" value="中国工商银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/3.png"></div></label>
        <label for="minsheng"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="minsheng" value="中国银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/4.png"></div></label>
        <label for="jianshe"><div class="bank"><input style="margin-left: 26px;position:relative;bottom: 8px" type="radio" name="bank" id="jianshe" value="中国建设银行" /><img style="width:180px;height:40px;margin-top: 24px;margin-left: 20px" src="__IMG__/5.png"></div></label>
    </div>
    <div style="position:fixed;bottom:0;left:0;width:100%;height:50px;">

        <button id="submit" class="bottom-btn botton2" type="button">提交</button>
    </div>
</form>
<div style="float:left;height:50px;margin-top: 10px;width: 100%;"></div>
{/block}
{block name="footer"}
<script type="text/javascript" src="__JS__/public.js"></script>
<script>
    $("#select").cityPicker({
        title: "请选择所在省市区",
        onChange: function (picker, values, displayValues) {
        },
        onClose: function(){
            var keyword =  $("#select").val();
        }
    });
    $(function(){
        $('.headimgurl').change(function () {
            var v_this = $(this);
            lrz(this.files[0],{width:640,fieldName:"image"}).then(function (rst) {
                var formdata = new FormData();
                v_this.parent().css("background-image","url("+rst.base64+")");//无论是否上传成功都显示
                url = "__BASE__/web.php/file/upload_picture_base64";
                formdata.append("image", rst.base64);
                $.ajax({
                    url : url,
                    type : 'post',
                    data : formdata,
                    contentType : false,
                    processData : false,
                    dataType : "json",
                    success : function(data) {
                        if (data.status == true) {
                            $.toast("图片上传成功");
                            v_this.next().val(data.info[0]['id']);
                        }
                    },
                    error:function(){
                        $.toast("图片上传失败");
                    }
                });
                return false;
            })
        });
    })
    $('#submit').click(function () {
        if($('#score').val()<100){
            $.toast("提现金额需要大于100",'cancel');
        }
            var body  ={
                name:$('#name').val(),
                score:$('#score').val(),
                bank_card_no:$('#bank_card_no').val(),
                mobile:$('#mobile').val(),
                bank_card_name:$('input[name="bank"]:checked').val(),
                pca:$('#select').val(),
                kh:$('#kh').val(),
            };
            var $this = $(this);
            $this.addClass('weui-btn_disabled').attr('disabled','disabled');
            ajax_post(getBaseUrl()+'/web.php/user/tixian',jQuery.param(body),{
                success:function(data){
                    $.toast("申请成功 请耐心等待结果",'success');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                    setTimeout(
                            function(){
                                history.back(-1);
                            }
                            ,1500);
                },
                error:function(data){
                    $.toptip(data.msg, 'error');
                    $this.removeClass('weui-btn_disabled').removeAttr("disabled");
                }
            })
    });
</script>
{/block}